﻿'*******************************************************************
' Program: Data Center Visio Rack Tool
' Author: Albert E Edlund
' Date:
'
' Purpose:
'
'
'
'*******************************************************************


Imports Microsoft.Practices.EnterpriseLibrary.Common
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging


Imports System
Imports System.ComponentModel
Imports System.Collections.Generic

Public Class dc_System
    Implements INotifyPropertyChanged


#Region "Events"

    Public Event PropertyChanged(ByVal sender As Object, ByVal e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

    Private Sub OnPropertyChanged(ByVal info As String)
        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
    End Sub

#End Region

#Region " Constructor "

    Public Sub New()
        initProperties()
    End Sub

    Public Sub New(ByVal strUserId As String)
        initProperties()
        Me.m_osLastEdit = strUserId
    End Sub

#End Region

#Region " Enumerations "


    Public Enum osSysTypes
        stWinWk9X = 41
        stWinWkNt = 42
        stWinWk2K = 43
        stWinWkXP = 44
        stWinSrvNt = 45
        ' nt 5.0
        stWinSrv2K = 46
        ' nt 5.1
        stWinSrvXP = 47
        ' nt 5.2
        stWinSrv2k3 = 48

        stUnixHP = 51
        stUnixSun = 52
        stUnixIBM = 53
        stUnixLinux = 54
        stOtherApple = 61

    End Enum


#End Region

#Region " Properties and Fields "

    Private m_osKey As Int32
    Private m_osCompKey As Int32
    Private m_osVirtualHostKey As Int32
    Private m_osSystemName As String
    Private m_osVendor As String
    Private m_osOperatingSystem As String
    Private m_osVersion As String
    Private m_osPlatform3264 As String
    Private m_OsServicePack As String
    Private m_osFixLevel As String
    Private m_osComments As String
    Private m_osLastEdit As String
    Private m_osLastUpdate As Date


    Private Const constOsKey As Int32 = -1
    Private Const constOsCompKey As Int32 = -1
    Private Const constOsVirtualHostKey As Int32 = -1
    Private Const constOsSystemName As String = "na"
    Private Const constOsVendor As String = "na"
    Private Const constOsOperatingSystem As String = "na"
    Private Const constOsVersion As String = "na"
    Private Const constOsPlatform3264 As String = "x64"
    Private Const constOsServicePack As String = "na"
    Private Const constOsFixLevel As String = "na"
    Private Const constOsComments As String = "none"
    Private Const constOsLastEdit As String = "na"
    Private Const constOsLastUpdate As Date = #1/1/2001#

    Public Property osKey() As Int32
        Get
            Return Me.m_osKey
        End Get
        Set(ByVal value As Int32)
            Me.m_osKey = value
            Me.OnPropertyChanged("osKey")
        End Set
    End Property

    Public Property osCompKey() As Int32
        Get
            Return Me.m_osCompKey
        End Get
        Set(ByVal value As Int32)
            Me.m_osCompKey = value
            Me.OnPropertyChanged("osCompKey")
        End Set
    End Property

    Public Property osVirtualHostKey() As Int32
        Get
            Return Me.m_osVirtualHostKey
        End Get
        Set(ByVal value As Int32)
            Me.m_osVirtualHostKey = value
            Me.OnPropertyChanged("osVirtualHostKey")
        End Set
    End Property

    Public Property osSystemName() As String
        Get
            Return Me.m_osSystemName
        End Get
        Set(ByVal value As String)
            Me.m_osSystemName = value
            Me.OnPropertyChanged("osSystemName")
        End Set
    End Property

    Public Property osVendor() As String
        Get
            Return Me.m_osVendor
        End Get
        Set(ByVal value As String)
            Me.m_osVendor = value
            Me.OnPropertyChanged("osVendor")
        End Set
    End Property

    Public Property osOperatingSystem() As String
        Get
            Return Me.m_osOperatingSystem
        End Get
        Set(ByVal value As String)
            Me.m_osOperatingSystem = value
            Me.OnPropertyChanged("osOperatingSystem")
        End Set
    End Property

    Public Property osVersion() As String
        Get
            Return Me.m_osVersion
        End Get
        Set(ByVal value As String)
            Me.m_osVersion = value
            Me.OnPropertyChanged("osVersion")
        End Set
    End Property

    Public Property osPlatform3264() As String
        Get
            Return Me.m_osPlatform3264
        End Get
        Set(ByVal value As String)
            Me.m_osPlatform3264 = value
            Me.OnPropertyChanged("osPlatform3264")
        End Set
    End Property

    Public Property OsServicePack() As String
        Get
            Return Me.m_OsServicePack
        End Get
        Set(ByVal value As String)
            Me.m_OsServicePack = value
            Me.OnPropertyChanged("osServicePack")
        End Set
    End Property

    Public Property osFixLevel() As String
        Get
            Return Me.m_osFixLevel
        End Get
        Set(ByVal value As String)
            Me.m_osFixLevel = value
            Me.OnPropertyChanged("osFixLevel")
        End Set
    End Property

    Public Property osComments() As String
        Get
            Return Me.m_osComments
        End Get
        Set(ByVal value As String)
            Me.m_osComments = value
            Me.OnPropertyChanged("osComments")
        End Set
    End Property

    Public Property osLastEdit() As String
        Get
            Return Me.m_osLastEdit
        End Get
        Set(ByVal value As String)
            Me.m_osLastEdit = value
            Me.OnPropertyChanged("osLastEdit")
        End Set
    End Property

    Public Property osLastUpdate() As Date
        Get
            Return Me.m_osLastUpdate
        End Get
        Set(ByVal value As Date)
            Me.m_osLastUpdate = value
            Me.OnPropertyChanged("osLastUpdate")
        End Set
    End Property




#End Region

#Region " Methods "


    Public Sub initProperties()

        Try

            osKey = constOsKey
            osCompKey = constOsCompKey
            osVirtualHostKey = constOsVirtualHostKey
            osSystemName = constOsSystemName
            osVendor = constOsVendor
            osOperatingSystem = constOsOperatingSystem
            osVersion = constOsVersion
            osPlatform3264 = constOsPlatform3264
            OsServicePack = constOsServicePack
            osFixLevel = constOsFixLevel
            osComments = constOsComments
            osLastEdit = constOsLastEdit
            osLastUpdate = Now

        Catch ex As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(ex, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub



#End Region


End Class



